﻿Chenxin.UI.ShowListPreliminary = Chenxin.extend(Chenxin.UI.PageCommon,{
    autoInitForm:false,
    actionUrl:'/service/logic/ShowListPreliminary.ashx',
    createSearch:function(){
        return new Chenxin.UI.ShowListPreliminarySearch({
            scope: this,
            actionUrl: this.actionUrl+'?op=search'
        });
    },
    createGrid: function() {
		return new Chenxin.UI.MultiRowGrid({
            actionUrl: this.actionUrl+'?op=search',
            id: 'preliminary',
            renderTo: 'Preliminary_table',
			hasCheckBox:false,
			pageSize: 50,
			height:258,
			cellBorder:true,
			modelId:'RecordId',
			scope:this,
			columns:{
				RecordId:{
					create:false,
					head:'id'
				},
				IsPreliminaryReply:{
					width:50,
					head:'预审回复',
					canExport:false,
					renderer:function(val,c,row){
						if(row.PreliminaryStatus>=30){
							return '<input type="checkbox" disabled="disabled" checked="checked"/>';
						}
						return '<input type="checkbox" disabled="disabled"/>';
					}
				},
				IsLoan:{
					width:50,
					head:'预约贷款',
					canExport:false,
					renderer:function(val,c,row){
						if(row.PreliminaryStatus>=40){
							return '<input type="checkbox" disabled="disabled" checked="checked"/>';
						}
						return '<input type="checkbox" disabled="disabled"/>';
					}
				},
				IsLoanReply:{
					width:50,
					head:'预约回复',
					canExport:false,
					renderer:function(val,c,row){
						if(row.PreliminaryStatus>=60){
							return '<input type="checkbox" disabled="disabled" checked="checked"/>';
						}
						return '<input type="checkbox" disabled="disabled"/>';
					}
				},
				PreliminaryApplyDate:{
					width:80,
					head:'预审申请日'
				},
				LoanApplyDate:{
					width:130,
					head:'预约贷款日'
				},
				OrderPlace:{
					width:100,
					head:'签约地点'
				},
				Address:{
					width:150,
					head:'房源地址'
				},
				Customer:{
					width:60,
					items:{
						CustomerName:{
							width:60,
							head:'主贷人'
						},
						SpousesName:{
							width:60,
							head:'配偶'
						}
					}
				},
				ID:{
					width:140,
					items:{
						IDNum:{
							width:140,
							head:'主贷人身份证',
							textModel:true
						},
						SpousesIDNum:{
							width:140,
							head:'配偶身份证',
							textModel:true
						}
					}
				},
				GJJ:{
					width:100,
					items:{
						GJJNum:{
							width:100,
							head:'主贷人公积金',
							textModel:true
						},
						SpousesGJJNum:{
							width:100,
							head:'配偶公积金',
							textModel:true
						}
					}
				},
				OrderBank:{
					width:100,
					head:'签约银行'
				},
				CompleteYear:{
					width:80,
					head:'竣工日期'
				},
				Total_Floor:{
					width:70,
					head:'总楼层'
				},
				BuildingArea:{
					width:80,
					head:'建筑面积'
				},
				BuildingType:{
					width:80,
					head:'建筑类型'
				},
				GJJmoney:{
					width:100,
					head:'公积金贷款金额'
				},
				GJJyear:{
					width:100,
					head:'公积金贷款年限'
				},
				SYMoney:{
					width:100,
					head:'商业贷款金额'
				},
				SYYear:{
					width:100,
					head:'商业贷款年限'
				},
				SalePrice_T:{
					width:100,
					head:'成交价'
				},
				EstimatePrice:{
					width:100,
					head:'评估价'
				},
				LoanTotalMoney:{
					width:100,
					head:'贷款金额'
				},
				LoanInfo:{
					width:70,
					head:'贷款类型'
				},
				AppDepartName:{
					width:70,
					head:'申请部门'
				},
				AppEmployeeName:{
					width:70,
					head:'申请人'
				},
				EmpDepartName:{
					width:70,
					head:'房源所属门店'
				},
				EmployeeName:{
					width:70,
					head:'房源所属业务员'
				},
				EmpPhone:{
					width:80,
					head:'联系电话',
					textModel:true
				},
				OperateQuanZ:{
					width:70,
					head:'是否外接',
					renderer:function(val,c,row){
						if(val==false){
							return "否";
						}
						else
						{
						    return "是";
						}
					}
				}
			}
		});
    },
    loadinfo: function(callback,scope) {
        var _this = this;
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            async:false,
            url: this.actionUrl,
            data: { op: 'getmodel', modelid: this.currentId },
            onSuccess: function(data, msg) {
                if (data) {
                    _this.currentPreliminary = data;
                    if(callback){
                        callback.call(scope);
                    }
                }
            }
        });
    },
    loadLoan: function(callback,scope) {
        var _this = this;
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            async:false,
            url: '/service/logic/DealLoan.ashx',
            data: { op: 'getmodel', modelid: this.currentId },
            onSuccess: function(data, msg) {
                _this.currentLoan = data;
                if(callback){
                    callback.call(scope);
                }
            }
        });
    },
    loadCustomer: function() {
        var _this = this;
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            async: false,
            url: this.actionUrl,
            data: { op: 'searchCustomer',modelid: this.currentId},
            onSuccess: function(data, msg) {
                if (data) {
                    _this.currentCustomer = data;
                }
            }
        });
    },
    del: function() {
        var _this = this;
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            async:false,
            url: this.actionUrl,
            data: { op: 'deletepreliminary', modelid: this.currentId },
            onSuccess: function(data, msg) {
                alert("撤销成功！");
                 _this.grid.reload();
            }
        });
    },
    res: function() {
        var _this = this;
        Chenxin.ajax({
            type: "get",
            dataType: "text",
            paramType: 'json',
            async:false,
            url: this.actionUrl,
            data: { op: 'resumeloan', modelid: this.currentId },
            onSuccess: function(data, msg) {
                 alert("恢复成功！");
                 _this.grid.reload();
            }
        });
    },
    initEvent:function(){
        var objPreliminary = this;

        /*************************事件：起始日期得到焦点************************/
        $("#DateFr").focus(function(){
            WdatePicker({dateFmt:'yyyy-MM-dd',oncleared:function(){$(this).blur();},onpicked:function(){$(this).blur();}})
        });
         /*************************事件：起始日期得到焦点************************/
        $("#DateTo").focus(function(){
            WdatePicker({dateFmt:'yyyy-MM-dd',oncleared:function(){$(this).blur();},onpicked:function(){$(this).blur();}})
        });
		
        /*************************事件：预审回复************************/
        $("#aReplyPre").click(function(){
            //预审回复显示
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
            objPreliminary.loadinfo(function(){
//                if(objPreliminary.currentPreliminary.PreliminaryStatus != 10 && objPreliminary.currentPreliminary.PreliminaryStatus != 20)
//                {
//                    alert("流程中未到或者已过预审回复阶段！");
//                }
//                else
//                {
//                    objPreliminary.showReplyPre();
//                }
                objPreliminary.loadCustomer();
                objPreliminary.showReplyPre();
            },this);
        });

        /*************************事件：预审修改************************/
        $("#aEditPre").click(function(){
            //预审修改显示
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
            
            objPreliminary.loadinfo(function(){
                if(objPreliminary.currentPreliminary.PreliminaryStatus < 10 || objPreliminary.currentPreliminary.PreliminaryStatus > 30)
                {
                    alert("流程中未到或者已过预审修改阶段！");
                }
                else
                {
                    Chenxin.Fn.checkPermit(objPreliminary.actionUrl,'updpreliminary',function(data,msg){
			            if(data.permit!=undefined){
				            objPreliminary.permit=data.permit;	
				            objPreliminary.msg = msg;
			            }
		            },this,{ modelid: objPreliminary.currentId });
		            if(objPreliminary.permit){			
                        window.location.href = "/page/Preliminary_Info/PreliminaryApply.aspx?recordid="+objPreliminary.currentId+"";
		            }else{
			            alert(objPreliminary.msg);
		            }
                }
            },this);
        });

        /*************************事件：外接预审************************/
        $("#aOperateQuanZ").click(function(){
            Chenxin.Fn.checkPermit(objPreliminary.actionUrl,'qz',function(data,msg){
		        if(data.permit!=undefined){
			        objPreliminary.permit=data.permit;
			        objPreliminary.msg = msg;
		        }
	        });
	        if(objPreliminary.permit){
                window.location.href = "/page/Preliminary_Info/PreliminaryApply.aspx?status=外接";
	        }else{
		        alert(objPreliminary.msg);
	        }
        });

        /*************************事件：预约贷款************************/
        $("#aApplyLoan").click(function(){
            //预约贷款显示
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
            objPreliminary.loadinfo(function(){
                if(objPreliminary.currentPreliminary.PreliminaryStatus != 30)
                {
                    alert("流程中未到或者已过预约贷款阶段！");
                }
                else
                {
                    objPreliminary.showApplyLoan();
                }
            },this);
        });

        /*************************事件：预约回复************************/
        $("#aReplyLoan").click(function(){
            //预约回复显示
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
            objPreliminary.loadinfo(function(){
//                if(objPreliminary.currentPreliminary.PreliminaryStatus != 40 && objPreliminary.currentPreliminary.PreliminaryStatus != 50)
//                {
//                    alert("流程中未到或者已过预约回复阶段！");
//                }
//                else
//                {
//                    objPreliminary.showReplyLoan();
//                }
                objPreliminary.loadCustomer();
                objPreliminary.showReplyLoan();
            },this);
        });

        /*************************事件：预约修改************************/
        $("#aEditLoan").click(function(){
            //预约修改复显示
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
            objPreliminary.loadinfo(function(){
                if(objPreliminary.currentPreliminary.PreliminaryStatus < 40 || objPreliminary.currentPreliminary.PreliminaryStatus > 60)
                {
                    alert("流程中未到或者已过预约修改阶段！");
                }
                else
                {
                    objPreliminary.showEditLoan();
                }
            },this);
        });

        /*************************事件：详情查看************************/
        $("#aShowDetial").click(function(){
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
//            Chenxin.Fn.checkPermit(objPreliminary.actionUrl,'viewpreliminaryinfo',function(data,msg){
//			    if(data.permit!=undefined){
//				    objPreliminary.permit=data.permit;	
//				    objPreliminary.msg = msg;
//			    }
//		    },this,{ modelid: objPreliminary.currentId });
//		    if(objPreliminary.permit){			
//                window.open ("/page/Preliminary_Info/ShowDetailPreliminary.aspx?recordid="+objPreliminary.currentId+"");
//		    }else{
//			    alert(objPreliminary.msg);
//		    }
            window.open ("/page/Preliminary_Info/ShowDetailPreliminary.aspx?recordid="+objPreliminary.currentId+"");
        });

        /*************************事件：受理人输入************************/
//        $("#aInputSL").click(function(){
//            var status = true;
//            //受理人输入显示
//            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
//                alert("请先选择一条预审记录！");
//                return;
//            }
//            objPreliminary.loadinfo(function(){
//                if(objPreliminary.currentPreliminary.PreliminaryStatus < 60)
//                {
//                    alert("流程中未到受理人输入阶段！");
//                    status = false;
//                }
//            },this);
//            if(status==true)
//            {
//                objPreliminary.loadLoan(function(){
//                    if((objPreliminary.currentLoan != "" || objPreliminary.currentLoan != undefined) && objPreliminary.currentLoan.Status >= 10)
//                    {
//                        alert("流程中已做受理人输入，只能修改！");
//                    }
//                    else
//                    {
//                        window.open("/page/Preliminary_Info/DealLoan.aspx?recordid=" + objPreliminary.currentId+"");
//                    }
//                },this);
//            }
//        });

        $("#aInputSL").click(function(){
            var status = true;
            //受理人输入显示
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
            objPreliminary.loadinfo(function(){
                if(objPreliminary.currentPreliminary.PreliminaryStatus < 60)
                {
                    alert("流程中未到受理人输入阶段！");
                    status = false;
                }
            },this);
            if(status==true)
            {
                objPreliminary.loadLoan(function(){
                    window.open("/page/Preliminary_Info/DealLoan.aspx?recordid=" + objPreliminary.currentId+"");
                },this);
            }
        });

        /*************************事件：受理人修改************************/
//        $("#aUpdSL").click(function(){
//            //受理人输入显示
//            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
//                alert("请先选择一条预审记录！");
//                return;
//            }
//            objPreliminary.loadLoan(function(){
//                if(objPreliminary.currentLoan.SLDate == "" || objPreliminary.currentLoan.SLDate == undefined)
//                {
//                    alert("请先做受理人输入后才可修改！");
//                }
//                else
//                {
//                    window.open("/page/Preliminary_Info/DealLoan.aspx?recordid=" + objPreliminary.currentId+"");
//                }
//            },this);
//        });

//        /*************************事件：审核人输入************************/
//        $("#aInputSH").click(function(){
//            //审核人输入显示
//            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
//                alert("请先选择一条预审记录！");
//                return;
//            }
//            objPreliminary.loadLoan(function(){
//                if(objPreliminary.currentLoan == "" || objPreliminary.currentLoan == undefined || objPreliminary.currentLoan.Status < 10 || objPreliminary.currentLoan.Status >= 30)
//                {
//                    alert("流程中未到或者已过审核人输入阶段！");
//                }
//                else
//                {
//                    objPreliminary.SHInput();
//                }
//            },this);
//        });

//        /*************************事件：审核人修改************************/
//        $("#aUpdSH").click(function(){
//            //审核人输入显示
//            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
//                alert("请先选择一条预审记录！");
//                return;
//            }
//            objPreliminary.loadLoan(function(){
//                if(objPreliminary.currentLoan == "" || objPreliminary.currentLoan == undefined || objPreliminary.currentLoan.Status < 30 || objPreliminary.currentLoan.Status > 40)
//                {
//                   alert("流程中未到或者已过修改审核人输入阶段！");
//                }
//                else
//                {
//                   objPreliminary.SHEdit();
//                }
//            },this);
//        });

//        /*************************事件：放款人输入************************/
//        $("#aInputFK").click(function(){
//            //放款人显示
//            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
//                alert("请先选择一条预审记录！");
//                return;
//            }
//            objPreliminary.loadLoan(function(){
//                if(objPreliminary.currentLoan == "" || objPreliminary.currentLoan == undefined || objPreliminary.currentLoan.Status < 30 || objPreliminary.currentLoan.Status >= 50)
//                {
//                   alert("流程中未到或者已过放款人输入阶段！");
//                }
//                else
//                {
//                   objPreliminary.FKInput();
//                }
//            },this);
//        });

//        /*************************事件：放款人修改************************/
//        $("#aUpdFK").click(function(){
//            //放款人显示
//            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
//                alert("请先选择一条预审记录！");
//                return;
//            }
//            objPreliminary.loadLoan(function(){
//                if(objPreliminary.currentLoan == "" || objPreliminary.currentLoan == undefined || objPreliminary.currentLoan.Status < 50)
//                {
//                   alert("流程中未到或者已过修改放款人输入阶段！");
//                }
//                else
//                {
//                   objPreliminary.FKEdit();
//                }
//            },this);
//        });

        /*************************事件：撤销************************/
        $("#aDelete").live("click",function(){
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
            if(confirm("是否撤销该记录！")){
                objPreliminary.del();
            }
        });

         /*************************事件：恢复************************/
        $("#aResume").live("click",function(){
            if (objPreliminary.currentId == null || objPreliminary.currentId == "") {
                alert("请先选择一条预审记录！");
                return;
            }
            if(confirm("是否恢复该条记录！")){
                objPreliminary.res();
            }
        });
    },

    /**
    *预审回复
    */
    showReplyPre:function(){
        var _this = this;

        if (!this.ReplyPreForm) {
            this.ReplyPreForm = new Chenxin.UI.ReplyPreForm({
                scope: _this,
                alwaysCheckPermit: true,
                afterGetFormJson:function(json){
                    delete json.HouseCode;
                    delete json.Address;
                    delete json.BuildingArea;
                    delete json.BuildingType;
                    delete json.CompleteYear;
                    delete json.Total_Floor;
                    delete json.SalePrice_T;
                    delete json.LoanTotalMoney;
                },
                saveSucc:function(){
                    _this.grid.reload();
                    _this.currentId=null;
			    }
            });
        }
        this.ReplyPreForm.op = "replypreliminary";
        if(this.ReplyPreForm.show(this.ReplyPreForm.op, { currentId: _this.currentId })) {
            this.ReplyPreForm.reset();
            var _data = {};
            var _customer = this.currentCustomer;
            Chenxin.apply(_data,this.currentPreliminary);
//            delete _data.ProposeBank;
            this.ReplyPreForm.fitData(_data);
            this.ReplyPreForm.setTitle('预审回复');
            this.ReplyPreForm.grid.clear();
            this.ReplyPreForm.grid.render(_customer);
        }
    },

    /**
    *预约贷款
    */
    showApplyLoan: function() {
        var _this = this;

        if (!this.ApplyLoanForm) {
            this.ApplyLoanForm = new Chenxin.UI.ApplyLoanForm({
                scope: _this,
                alwaysCheckPermit: true,
                afterGetFormJson:function(json){
                    json.LoanApplyDate = json.LoanApplyDate;
                    delete json.HouseCode;
                    delete json.Address;
                },
                saveSucc:function(){
                    _this.grid.reload();
                    _this.currentId=null;
			    }
            });
        }
        this.ApplyLoanForm.op = "addloan";
        if(this.ApplyLoanForm.show(this.ApplyLoanForm.op, { currentId: _this.currentId })) {
            this.ApplyLoanForm.reset();
            var _data = {};
            Chenxin.apply(_data,this.currentPreliminary);
            //delete _data.OrderPlace;
            this.ApplyLoanForm.fitData(_data);
            this.ApplyLoanForm.setTitle('预约贷款');
        }
    },

    /**
    *预约修改
    */
    showEditLoan: function() {
        var _this = this;

        if (!this.ApplyLoanForm) {
            this.ApplyLoanForm = new Chenxin.UI.ApplyLoanForm({
                scope: _this,
                alwaysCheckPermit: true,
                afterGetFormJson:function(json){
                    delete json.HouseCode;
                    delete json.Address;
                },
                saveSucc:function(){
                    _this.grid.reload();
                    _this.currentId=null;
			    }
            });
        }
        this.ApplyLoanForm.op = "updloan";
        if(this.ApplyLoanForm.show(this.ApplyLoanForm.op, { currentId: _this.currentId })) {
            this.ApplyLoanForm.reset();
            var _data = this.currentPreliminary;
            this.ApplyLoanForm.fitData(_data);
            this.ApplyLoanForm.setTitle('预约修改');
        }
    },

    /**
    *预约回复
    */
    showReplyLoan: function() {
       var _this = this;

        if (!this.ReplyLoanForm) {
            this.ReplyLoanForm = new Chenxin.UI.ReplyLoanForm({
                scope: _this,
                alwaysCheckPermit: true,
                afterGetFormJson:function(json){
                    delete json.HouseCode;
                    delete json.Address;
                    delete json.BuildingArea;
                    delete json.BuildingType;
                    delete json.CompleteYear;
                    delete json.Total_Floor;
                    delete json.SalePrice_T;
                    delete json.LoanTotalMoney;
                },
                saveSucc:function(){
                    _this.grid.reload();
                    _this.currentId=null;
			    }
            });
        }
        this.ReplyLoanForm.op = "replyloan";
        if(this.ReplyLoanForm.show(this.ReplyLoanForm.op, { currentId: _this.currentId })) {
            this.ReplyLoanForm.reset();
            var _data = {};
            var _customer = this.currentCustomer;
            Chenxin.apply(_data,this.currentPreliminary);
            //delete _data.OrderBank;
            this.ReplyLoanForm.fitData(_data);
            this.ReplyLoanForm.setTitle('预约回复');
            this.ReplyLoanForm.grid.clear();
            this.ReplyLoanForm.grid.render(_customer);
        }
    },
    initComponent: function() {
        Chenxin.UI.ShowListPreliminary.superclass.initComponent.call(this);
    }

//    /**
//    *审核输入
//    */
//    SHInput: function() {
//        var _this = this;
//        if (!this.SHInputForm) {
//            this.SHInputForm = new Chenxin.UI.SHInputForm({
//                scope: _this,
//                alwaysCheckPermit: true,
//                afterGetFormJson:function(json){
//                    delete json.EmpCompanyId;
//                    delete json.EmpDepartId;
//                    delete json.EmployeeId;
//                    delete json.OperateCompanyId;
//                    delete json.OperateDepartId;
//                    delete json.OperateUserId;
//                    delete json.LoanCode;
//                    delete json.LoanInfo;
//                    delete json.LoanDealMode;
//                    delete json.EvaluateCorp;
//                    delete json.InsuranceCorp;
//                    delete json.LackInfo;
//                    delete json.ReceiveBank;
//                    delete json.LoanXfYear;
//                    delete json.LoanSxYear;
//                    delete json.LoanZyYear;
//                    delete json.SalerPhone;
//                    delete json.BuyerPhone;
//                    delete json.CustomerName;
//                    delete json.IDNum;
//                    delete json.GJJyear;
//                    delete json.SYYear;
//                    delete json.OrderPlace;
//                    delete json.SaleName;
//                    delete json.SaleIDCard;
//                    delete json.OldLoanBank;
//                    delete json.EmpCompanyName;
//                    delete json.EmpDepartName;
//                    delete json.EmployeeName;
//                    delete json.EmpPhone;
//                    delete json.OperateCompanyName;
//                    delete json.OperateDepartName;
//                    delete json.OperateUserName;
//                    delete json.SLRemark;
//                    delete json.FKRemark;
//                    delete json.EvaluateFee;
//                    delete json.InsuranceFee;
//                    delete json.AgencyFee;
//                    delete json.OutVouchFee;
//                    delete json.VouchFee;
//                    delete json.LoanXf;
//                    delete json.LoanSx;
//                    delete json.LoanZy;
//                    delete json.BankQueryFee;
//                    delete json.BankManageFee;
//                    delete json.LoanBankSaleComplete;
//                    delete json.EstimatePrice;
//                    delete json.GJJmoney;
//                    delete json.SYMoney;
//                    delete json.OldLoanMoney;
//                    delete json.OldRestMoney;
//                    delete json.BuildingArea;
//                    delete json.LoanContractDate;
//                    delete json.MortgageClearDate;
//                    delete json.LoanComplete;
//                    delete json.SendToBankDate;
//                    delete json.VoucherToBankDate;
//                    delete json.CertificateDate;
//                    delete json.BankCompleteDate;
//                    delete json.SLDate;
//                    delete json.SHDate;
//                    delete json.FKDate;
//                    delete json.UpSLDate;
//                    delete json.UpSHDate;
//                    delete json.UpFKDate;
//                    delete json.EvaluateFeeDate;
//                    delete json.VouchFeeDate;
//                    delete json.InsuranceFeeDate;
//                    delete json.AgencyFeeDate;
//                    delete json.OutVouchFeeDate;
//                    delete json.EndDate;
//                    delete json.CompleteLoanDate;
//                    delete json.IsNoEvaluateFee;
//                    delete json.IdBankReceipt;
//                    delete json.IdZhuanBen;
//                    delete json.IsNoAgencyFee;
//                    delete json.IdShouBen;
//                    delete json.IsLack;
//                    delete json.Receipt;
//                    delete json.Mortgage;
//                    delete json.Status;
//                    delete json.CompleteYear;
//                    delete json.Total_Floor;
//                },
//                saveSucc:function(){
//                    _this.grid.reload();
//                    _this.currentId=null;
//			    }
//            });
//        }
//        this.SHInputForm.op = "addSH";
//        if(this.SHInputForm.show(this.SHInputForm.op, { modelid: _this.currentId })) {
//            this.SHInputForm.reset();
//            this.SHInputForm.fitData({
//                RecordId:this.currentId
//            });
//            
//            var _data = this.currentLoan;
//            this.SHInputForm.fitData(_data);
//            this.SHInputForm.setTitle('审核输入');
//        }else{
//            alert('abc');
//        }
//    },
//    
//    /**
//    *审核修改
//    */
//    SHEdit: function() {
//        var _this = this;
//        
//        if (!this.SHInputForm) {
//            this.SHInputForm = new Chenxin.UI.SHInputForm({
//                scope: _this,
//                alwaysCheckPermit: true,
//                afterGetFormJson:function(json){
//                    delete json.EmpCompanyId;
//                    delete json.EmpDepartId;
//                    delete json.EmployeeId;
//                    delete json.OperateCompanyId;
//                    delete json.OperateDepartId;
//                    delete json.OperateUserId;
//                    delete json.LoanCode;
//                    delete json.LoanInfo;
//                    delete json.LoanDealMode;
//                    delete json.EvaluateCorp;
//                    delete json.InsuranceCorp;
//                    delete json.LackInfo;
//                    delete json.ReceiveBank;
//                    delete json.LoanXfYear;
//                    delete json.LoanSxYear;
//                    delete json.LoanZyYear;
//                    delete json.SalerPhone;
//                    delete json.BuyerPhone;
//                    delete json.CustomerName;
//                    delete json.IDNum;
//                    delete json.GJJyear;
//                    delete json.SYYear;
//                    delete json.OrderPlace;
//                    delete json.SaleName;
//                    delete json.SaleIDCard;
//                    delete json.OldLoanBank;
//                    delete json.EmpCompanyName;
//                    delete json.EmpDepartName;
//                    delete json.EmployeeName;
//                    delete json.EmpPhone;
//                    delete json.OperateCompanyName;
//                    delete json.OperateDepartName;
//                    delete json.OperateUserName;
//                    delete json.SLRemark;
//                    delete json.FKRemark;
//                    delete json.EvaluateFee;
//                    delete json.InsuranceFee;
//                    delete json.AgencyFee;
//                    delete json.OutVouchFee;
//                    delete json.VouchFee;
//                    delete json.LoanXf;
//                    delete json.LoanSx;
//                    delete json.LoanZy;
//                    delete json.BankQueryFee;
//                    delete json.BankManageFee;
//                    delete json.LoanBankSaleComplete;
//                    delete json.EstimatePrice;
//                    delete json.GJJmoney;
//                    delete json.SYMoney;
//                    delete json.OldLoanMoney;
//                    delete json.OldRestMoney;
//                    delete json.BuildingArea;
//                    delete json.LoanContractDate;
//                    delete json.MortgageClearDate;
//                    delete json.LoanComplete;
//                    delete json.SendToBankDate;
//                    delete json.VoucherToBankDate;
//                    delete json.CertificateDate;
//                    delete json.BankCompleteDate;
//                    delete json.SLDate;
//                    delete json.SHDate;
//                    delete json.FKDate;
//                    delete json.UpSLDate;
//                    delete json.UpSHDate;
//                    delete json.UpFKDate;
//                    delete json.EvaluateFeeDate;
//                    delete json.VouchFeeDate;
//                    delete json.InsuranceFeeDate;
//                    delete json.AgencyFeeDate;
//                    delete json.OutVouchFeeDate;
//                    delete json.EndDate;
//                    delete json.CompleteLoanDate;
//                    delete json.IsNoEvaluateFee;
//                    delete json.IdBankReceipt;
//                    delete json.IdZhuanBen;
//                    delete json.IsNoAgencyFee;
//                    delete json.IdShouBen;
//                    delete json.IsLack;
//                    delete json.Receipt;
//                    delete json.Mortgage;
//                    delete json.Status;
//                    delete json.CompleteYear;
//                    delete json.Total_Floor;
//                },
//                saveSucc:function(){
//                    _this.grid.reload();
//                    _this.currentId=null;
//			    }
//            });
//        }
//        this.SHInputForm.op = "updSH";
//        if(this.SHInputForm.show(this.SHInputForm.op, { currentId: _this.currentId })) {
//            this.SHInputForm.reset();
//            this.SHInputForm.fitData({
//                RecordId:this.currentId
//            });
//            var _data = this.currentLoan;
//            this.SHInputForm.fitData(_data);
//            this.SHInputForm.setTitle('审核修改');
//        }
//    },
//    
//    /**
//    *放款输入
//    */
//    FKInput: function() {
//        var _this = this;
//        
//        if (!this.FKInputForm) {
//            this.FKInputForm = new Chenxin.UI.FKInputForm({
//                scope: _this,
//                alwaysCheckPermit: true,
//                afterGetFormJson:function(json){
//                    delete json.EmpCompanyId;
//                    delete json.EmpDepartId;
//                    delete json.EmployeeId;
//                    delete json.OperateCompanyId;
//                    delete json.OperateDepartId;
//                    delete json.OperateUserId;
//                    delete json.LoanCode;
//                    delete json.LoanInfo;
//                    delete json.LoanDealMode;
//                    delete json.EvaluateCorp;
//                    delete json.InsuranceCorp;
//                    delete json.LackInfo;
//                    delete json.ReceiveBank;
//                    delete json.LoanXfYear;
//                    delete json.LoanSxYear;
//                    delete json.LoanZyYear;
//                    delete json.SalerPhone;
//                    delete json.BuyerPhone;
//                    delete json.CustomerName;
//                    delete json.IDNum;
//                    delete json.GJJyear;
//                    delete json.SYYear;
//                    delete json.OrderPlace;
//                    delete json.SaleName;
//                    delete json.SaleIDCard;
//                    delete json.OldLoanBank;
//                    delete json.EmpCompanyName;
//                    delete json.EmpDepartName;
//                    delete json.EmployeeName;
//                    delete json.EmpPhone;
//                    delete json.OperateCompanyName;
//                    delete json.OperateDepartName;
//                    delete json.OperateUserName;
//                    delete json.SLRemark;
//                    delete json.SHRemark;
//                    delete json.EvaluateFee;
//                    delete json.InsuranceFee;
//                    delete json.AgencyFee;
//                    delete json.OutVouchFee;
//                    delete json.VouchFee;
//                    delete json.LoanXf;
//                    delete json.LoanSx;
//                    delete json.LoanZy;
//                    delete json.BankQueryFee;
//                    delete json.BankManageFee;
//                    delete json.LoanBankSaleComplete;
//                    delete json.EstimatePrice;
//                    delete json.GJJmoney;
//                    delete json.SYMoney;
//                    delete json.OldLoanMoney;
//                    delete json.OldRestMoney;
//                    delete json.BuildingArea;
//                    delete json.LoanContractDate;
//                    delete json.MortgageClearDate;
//                    delete json.LoanComplete;
//                    delete json.BankLoanDate;
//                    delete json.ReceiveLoanDate;
//                    delete json.SendToBankDate;
//                    delete json.SLDate;
//                    delete json.SHDate;
//                    delete json.FKDate;
//                    delete json.UpSLDate;
//                    delete json.UpSHDate;
//                    delete json.UpFKDate;
//                    delete json.EvaluateFeeDate;
//                    delete json.VouchFeeDate;
//                    delete json.InsuranceFeeDate;
//                    delete json.AgencyFeeDate;
//                    delete json.OutVouchFeeDate;
//                    delete json.EndDate;
//                    delete json.EstimReportBackDate;
//                    delete json.IsNoEvaluateFee;
//                    delete json.IdBankReceipt;
//                    delete json.IdZhuanBen;
//                    delete json.IsNoAgencyFee;
//                    delete json.IdShouBen;
//                    delete json.IsLack;
//                    delete json.Receipt;
//                    delete json.Mortgage;
//                    delete json.Status;
//                    delete json.CompleteYear;
//                    delete json.Total_Floor;
//                },
//                saveSucc:function(){
//                    _this.grid.reload();
//                    _this.currentId=null;
//			    }
//            });
//        }
//        this.FKInputForm.op = "addFK";
//        if(this.FKInputForm.show(this.FKInputForm.op, { currentId: _this.currentId })) {
//            this.FKInputForm.reset();
//            this.FKInputForm.fitData({
//                RecordId:this.currentId
//            });
//            var _data = this.currentLoan;
//            this.FKInputForm.fitData(_data);
//            this.FKInputForm.setTitle('放款输入');
//        }
//    },
//    
//    /**
//    *放款修改
//    */
//    FKEdit: function() {
//        var _this = this;
//        
//        if (!this.FKInputForm) {
//            this.FKInputForm = new Chenxin.UI.FKInputForm({
//                scope: _this,
//                alwaysCheckPermit: true,
//                afterGetFormJson:function(json){
//                    delete json.EmpCompanyId;
//                    delete json.EmpDepartId;
//                    delete json.EmployeeId;
//                    delete json.OperateCompanyId;
//                    delete json.OperateDepartId;
//                    delete json.OperateUserId;
//                    delete json.LoanCode;
//                    delete json.LoanInfo;
//                    delete json.LoanDealMode;
//                    delete json.EvaluateCorp;
//                    delete json.InsuranceCorp;
//                    delete json.LackInfo;
//                    delete json.ReceiveBank;
//                    delete json.LoanXfYear;
//                    delete json.LoanSxYear;
//                    delete json.LoanZyYear;
//                    delete json.SalerPhone;
//                    delete json.BuyerPhone;
//                    delete json.CustomerName;
//                    delete json.IDNum;
//                    delete json.GJJyear;
//                    delete json.SYYear;
//                    delete json.OrderPlace;
//                    delete json.SaleName;
//                    delete json.SaleIDCard;
//                    delete json.OldLoanBank;
//                    delete json.EmpCompanyName;
//                    delete json.EmpDepartName;
//                    delete json.EmployeeName;
//                    delete json.EmpPhone;
//                    delete json.OperateCompanyName;
//                    delete json.OperateDepartName;
//                    delete json.OperateUserName;
//                    delete json.SLRemark;
//                    delete json.SHRemark;
//                    delete json.EvaluateFee;
//                    delete json.InsuranceFee;
//                    delete json.AgencyFee;
//                    delete json.OutVouchFee;
//                    delete json.VouchFee;
//                    delete json.LoanXf;
//                    delete json.LoanSx;
//                    delete json.LoanZy;
//                    delete json.BankQueryFee;
//                    delete json.BankManageFee;
//                    delete json.LoanBankSaleComplete;
//                    delete json.EstimatePrice;
//                    delete json.GJJmoney;
//                    delete json.SYMoney;
//                    delete json.OldLoanMoney;
//                    delete json.OldRestMoney;
//                    delete json.BuildingArea;
//                    delete json.LoanContractDate;
//                    delete json.MortgageClearDate;
//                    delete json.LoanComplete;
//                    delete json.BankLoanDate;
//                    delete json.ReceiveLoanDate;
//                    delete json.SendToBankDate;
//                    delete json.SLDate;
//                    delete json.SHDate;
//                    delete json.FKDate;
//                    delete json.UpSLDate;
//                    delete json.UpSHDate;
//                    delete json.UpFKDate;
//                    delete json.EvaluateFeeDate;
//                    delete json.VouchFeeDate;
//                    delete json.InsuranceFeeDate;
//                    delete json.AgencyFeeDate;
//                    delete json.OutVouchFeeDate;
//                    delete json.EndDate;
//                    delete json.EstimReportBackDate;
//                    delete json.IsNoEvaluateFee;
//                    delete json.IdBankReceipt;
//                    delete json.IdZhuanBen;
//                    delete json.IsNoAgencyFee;
//                    delete json.IdShouBen;
//                    delete json.IsLack;
//                    delete json.Receipt;
//                    delete json.Mortgage;
//                    delete json.Status;
//                    delete json.CompleteYear;
//                    delete json.Total_Floor;
//                },
//                saveSucc:function(){
//                    _this.grid.reload();
//                    _this.currentId=null;
//			    }
//            });
//        }
//        this.FKInputForm.op = "updFK";
//        if(this.FKInputForm.show(this.FKInputForm.op, { currentId: _this.currentId })) {
//            this.FKInputForm.reset();
//            this.FKInputForm.fitData({
//                RecordId:this.currentId
//            });
//            var _data = this.currentLoan;
//            this.FKInputForm.fitData(_data);
//            this.FKInputForm.setTitle('放款修改');
//        }
//    }
});

/**
*查询面板
*/
Chenxin.UI.ShowListPreliminarySearch=Chenxin.extend(Chenxin.UI.SearchCommon,{
    id:'preliminary_search',
    initEvent:function(){
        var _this=this;
        
        //导出Excel
        $('#aExportExcel').click(function() {
            _this.exportData();
        });

        //查询按钮
        $('#btSreachPre').click(function(){
			_this.scope.searchGrid();
        });

        $('#KeyWord').defText({
            deftxt: '请输入地址或客户姓名'
        });
    },
    createComboList: function(){
        //日期查询类型
        var ComboDateType = new Chenxin.UI.Combo({
            containerId: '#DateType',
            tbxWidth: 75,
            colWidth: 80,
            items: comboCommon.PreliminaryDateType
        });

        //预审流程
        var ComboPreliminaryStatus = new Chenxin.UI.Combo({
            containerId: '#PreliminaryStatus',
            tbxWidth: 75,
            colWidth: 80,
            items: comboCommon.PreliminaryStatus
        });

        //预审来源
        var ComboOperateQuanZ = new Chenxin.UI.Combo({
            containerId: '#OperateQuanZ',
            tbxWidth: 80,
            colWidth: 80,
            items: comboCommon.OperateQuanZ
        });

        //签约地点
        var ComboOrderPlace = new Chenxin.UI.Combo({
            containerId: '#OrderPlace',
            tbxWidth: 80,
            colWidth: 105,
            items: comboCommon.OrderPlace
        });

        //五级联Combo
        var combl = new Chenxin.UI.StructComboList();
        var structs = combl.comboList;
        structs.push(ComboDateType);
        structs.push(ComboPreliminaryStatus);
        structs.push(ComboOperateQuanZ);
        structs.push(ComboOrderPlace);
        return structs;
    },
    initComponent: function() {
        Chenxin.UI.ShowListPreliminarySearch.superclass.initComponent.call(this);
    }
});

getcity = true; //设置需要获取城市下拉框数据

$(document).ready(function(){
    var showlistpreliminary = new Chenxin.UI.ShowListPreliminary();
});